home *** CD-ROM | disk | FTP | other *** search
- #
- # Line printer intercept for SunFax
- #
- # SCCS: model 1.2 94/10/31
- #
- # ****************************************************************************
- # * *
- # * *
- # * Copyright Faximum Software Inc. 1994 *
- # * *
- # * All Rights Reserved. An unpublished and CONFIDENTIAL work. *
- # * Reproduction, adaptation, or translation without prior written *
- # * permission is prohibited except as allowed under the copyright laws. *
- # * *
- # * *
- # * RESTRICTED RIGHTS LEGEND *
- # * *
- # * Use, duplication, or disclosure by the U.S. Government is subject to *
- # * restrictions as set forth in subparagraph (c) (1) (ii) of the Rights *
- # * in Technical Data and Computer Software clause in DFARS 252.227-7013. *
- # * Rights for non-DOD U.S. Government Departments and Agencies are as set *
- # * forth in FAR 52.227-19(c) (1,2). *
- # * *
- # * Faximum Software Inc. *
- # * 1497 Marine Drive, Suite 300 *
- # * West Vancouver, BC, Canada, V7T 1B8 *
- # * *
- # ****************************************************************************
- #
- trap "rm -rf /tmp/fxm.$$*" 1 2 15
- FAXHOME=`pkginfo -r FAXclient`
-
- #
- # These are the default parameters for style, account, and class.
- # Change as appropriate
- #
-
- STYLE="No Cover Sheet (Fine)"
- ACCOUNT="Default"
- CLASS="Default"
-
- #
- # The following ought to point to the name of the system which is
- # running the fax server. On SunFax installations, this is the localhost,
- # on fully networked client/server installations this is usually the
- # alias faxhost although any valid hostname may be used.
-
- FAXHOST=localhost
- export FAXHOST
-
- #
- # A place to put things...
- #
- TF=/tmp/fxm.$$
-
- #
- # Check that the fax number has been provided in a -o option of the form
- # "fax=112344556" and extract the number itself...
- #
-
- num=`expr "$5" : "fax=\(.*\)"`
- if [ -z "$num" ]
- then
- echo "Invalid fax number option specified. ($5)" 1>&2
- echo 'Usage: lp -d fax -o "fax=1 234 567"' 1>&2
- exit 1
- fi
-
- #
- # Put all of the parameters into our temp file...
- #
-
- cat >> ${TF}.c <<- EOF
- dest_fax1 = "$num"
- class = "$CLASS"
- style = "$STYLE"
- account = "$ACCOUNT"
- file_name1 = $6
- EOF
-
- #
- # And send the command file off to submitfax...
- #
- ${FAXHOME}/FAXclient/lib/submitfax ${TF}.c 1>&2
- rm -f ${TF}.c
-